package com.hl.payServer.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 * Entity支持类
 *
 * @author ThinkGem
 * @version 2014-05-16
 */
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;
    public BaseEntity(){
    }

    /**
     *创建日期
     */
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "createTime")
    protected Date createTime;
    /**
     *更新日期
     */
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "updateTime")
    protected Date updateTime;

    public void initCreateTime(){
        this.createTime = new Date();
    }
    public void initUpdateTime(){
        this.updateTime = new Date();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

}
